package com.example.demo99.Mapper;

import com.example.demo99.Entity.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
@Mapper

public interface OrderMapper {
    void insertOrder(Order order);
    void insertOrderProduct(@Param("orderId") Integer orderId, @Param("productId") Integer productId, @Param("quantity") Integer quantity);
    List<Order> findAllOrders();
    Order findById(@Param("id") Integer id);


    void updateStatus(@Param("orderId") Integer orderId, @Param("status") String status); // ✅新增

    List<Order> findTimeoutOrders(LocalDateTime deadline);
}
